// everybody 's parent
#ifndef __WDS_OBJECT_H__
#define __WDS_OBJECT_H__

#include "math/vec2.h"

#include <vector>
#include <math.h>
#include <set>


enum OBJECTTYPE
{
	OBJ_DEFAULT,
	OBJ_PLAYER,
	OBJ_ENEMY,
	OBJ_BULLET,
	OBJ_BUILDING,
	OBJ_VIEWPORT,
	OBJ_CURSOR,
	OBJ_UNKNOWN
};

class WDSObject
{
	//static CObject *mViewport;

	
	//static hgeRect hitObjectAABB;
	
	public:
	WDSObject();
	~WDSObject(){}
	
	//void setViewport(CObject *pViewport);
	virtual void update(float elaspsedTime){}	
	bool Move(float pX,float pY);
	

	bool getIsAlive() const { return m_IsAlive; };
	bool getIsInsideScreen() const;
	bool getIsNearScreen() const;
	
	WDSObject* getCurrentCollideObject() const;

	virtual inline int getType() const{return OBJ_DEFAULT;}
	virtual void hit() {}

	void hit(WDSObject* pCObject);
	void clearNeighborObjectList();	
	void addCollideableType(OBJECTTYPE pObjectType);	
	bool isCollideableType(int pObjectType);
	void addKillableType(int pObjectType);	
	bool isKillableType(int pObjectType);
	
	

	
	
protected:

	math::Vec2 m_Pos;
	math::Vec2 m_Size;
	float m_Radius;	
	math::Vec2 m_PreviousPos;
	
	int mLimitX;
	int mLimitY;

	float mRotation;
	unsigned long mColor;	
	float mMoveSpeed;
	bool m_IsAlive;
	std::vector<WDSObject*> mNeighbourList;
	WDSObject *mCurrentCollideObject;

	void init(float pX,float pY,float pWidth,float pHeight,int pLimitX,int pLimitY,float pMoveSpeed);
	void setColor(unsigned long pColor);	
	void setX(float pX);	
	void setY(float pY);
	void setWidth(float pW);	
	void setHeight(float pH);
	void setMoveSpeed(float pMoveSpeed);

	std::set <int> mCollideableTypeList;
	std::set <int> mKillableTypeList;
	



};

#endif	// __WDS_OBJECT_H__

